package src.itheima03;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class C {
    public static void main(String[] args) {
        //2.创建LinkedHashMap集合对象,键: Student 值: String 地址
        Map<B,String>map=new LinkedHashMap();
        //3.LinkedHashMap集合对象调用put方法,添加多个键值对
        map.put(new B(1,"2122"),"s");
        map.put(new B(2,"5566"),"334");
        map.put(new B(3,"6666"),"99");
        map.put(new B(4,"777"),"34");
        //4.LinkedHashMap集合对象调用entrySet方法,获取所有的键值对(Entry对象)对应的Set集合
        Set<Map.Entry<B,String>>set=map.entrySet();
      /*  System.out.println(set);*/
        //5.遍历所有所有的键值对(Entry对象)对应的Set集合
        for (Map.Entry<B, String> entry : set) {
            B aa=entry.getKey();
            String bb=entry.getValue();

            System.out.println(aa+"---"+bb);

        }
        //获取键
        //获取值

    }
}
